import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main3 {
    public static boolean isZhi(int n) {
        if(n == 2) {
            return true;
        }
        int k = (int)Math.pow(n, .5);
        for (int i = 3; i <= k; i += 2) {
            if(n % i == 0) {
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //处理输入数值，将其拆分为多个质数相乘
        List<Integer> pow = new ArrayList<>();
        List<Integer> type = new ArrayList<>();
        double n = (double) in.nextInt();
        int z = 2;
        int index = 0;
        while(n > 1) {
            if(n % z == 0) {//可以被整除
                n /= z;
                index = type.indexOf(z);
                if(index == -1) {//没有该元素
                    pow.add(1);
                    type.add(z);
                } else {//有就加1
                    pow.set(index, pow.get(index) + 1);
                }
            } else {//不能被整除
                //找到下一个质数
                z++;
                while(!isZhi(z)) {
                    z++;
                }
            }
        }
        //此时已经分解好，从后向前
        int len = type.size();
        if(len == 1) {//只有一个
            System.out.println((int)Math.pow(type.get(0) , pow.get(0)));
            return;
        }
        if((len & 1) == 0) {
            System.out.println(1);
            return;
        }
        //因素有两个及以上
        int sum = 0;
        int maxCount = 0;
        for (int i = 0; i < len; i++) {
            int num = pow.get(i);
            sum += num;
            if(maxCount < num) {
                maxCount = num;
            }
        }
        if((sum & 1) == 1 && maxCount == 1) {
            System.out.println(type.get(0));
            return;
        }
        System.out.println(1);
    }
}
